package ats.org.web.ManagedBeans;

import java.util.List;

import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.ViewScoped;

import ats.org.Service.WebApplicationService;
import ats.org.entities.WebApplication;

@ManagedBean(name = "WebApplicationMB")
@ViewScoped
public class WebApplicationMB {
	
	private WebApplication entity;
	private List<WebApplication> entitiesList;
	
	@ManagedProperty("#{WebApplicationService}")
	private WebApplicationService service;

	@PostConstruct
	public void init(){
		setEntitiesList(getService().getAllApplications());
	}
	
	public WebApplication getEntity() {
		return entity;
	}

	public void setEntity(WebApplication entity) {
		this.entity = entity;
	}

	public List<WebApplication> getEntitiesList() {
		return entitiesList;
	}

	public void setEntitiesList(List<WebApplication> entitiesList) {
		this.entitiesList = entitiesList;
	}

	public WebApplicationService getService() {
		return service;
	}

	public void setService(WebApplicationService service) {
		this.service = service;
	}

}
